(function flexible(window, document) {
  // reset root font size on page show or resize
  window.addEventListener('pageshow', resetFontSize);
  window.addEventListener('resize', resetFontSize);
})(window, document);

function resetFontSize() {
    let size = document.documentElement.clientWidth
    if(size>750){
        size=750;
    }else if (size<320){
        size=320;
    }
    document.documentElement.style.fontSize = 100*(size/(750))+'px'
}
resetFontSize()
